Tutorials

Calling REST Endpoints with GPAL.RESTClient

GPAL.RESTClient gives you a fluent, chainable client for talking to any REST API - including GPAL's own OttoMagic browser-automation API. This tutorial drives a remote browser purely through REST calls: opening tabs, navigating, filling in forms, scrolling, and reading page state, all with the same With*/Execute pattern.

Chaining Browser Actions Through GPAL.RESTClient with AndThen

GPAL.RESTClient is the general-purpose fluent REST client behind browser.OttoMagicClient. Point it at any API base, pick an ApiEndpoint, and chain calls together with AndThen<T>() - each step's result can be named and reused by a later step, building a multi-step browser workflow out of individual REST calls.

Talking to an OpenAPI-Described Service

If a service publishes an OpenAPI (Swagger) document, GPAL.RESTClient can load it directly and discover its endpoints for you. This short tutorial loads a spec, lists its endpoints, calls one, and pretty-prints the JSON response with GPAL.Converter.

Seeing What a Page Asks For with CaptureCalls

A page's own network calls are the API it was built against, and they are already going past you. CaptureCalls records every request the browser makes, WithCallFilter narrows the recording to the ones that matter, and CaptureCallTemplate hands one back as a request you can issue again. This is how an endpoint gets read off a site instead of guessed at.

Calling a Site's Own API with Fetch

Scraping the DOM reads what a site chose to draw. Fetch asks the API the site drew it from, and issues the request from inside the page, so it carries the cookies, the TLS fingerprint, the header order and any anti-bot clearance the browser already earned. One request declaration serves every search term and every page.

Carrying the Session Out of the Browser with ContinueAsRESTClient

A browser that has signed in is holding something worth keeping. ContinueAsRESTClient hands back a RESTClient carrying the origin, the cookies, the user agent and accept language the browser is really sending, and any credentials it was given. The browser can be closed on the next line and the client keeps working.

💬 Ask GPAL